<template>
  <div>
    <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>基本信息</span></div>
      <div>
        <div class="tableStyle">
          <div class="labelS">调拨编号</div>
          <div class="contentS">{{infoDetail.transferNum}}</div>
          <div class="labelS">申请时间</div>
          <div class="contentS">{{infoDetail.applyTime}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">申请人</div>
          <div class="contentS">{{infoDetail.createBy}}</div>
          <div class="labelS">当前节点</div>
          <div class="contentS">{{infoDetail.currentNode}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">申请原因</div>
          <div class="contentS">{{infoDetail.reason}}</div>
        </div>
      
      </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">相关附件</span>
       <el-upload
           v-if='infoDetail.fileArray.length>0'
            ref="upload"
            :disabled='true'
            class="upload-demo"
            action="/admin/sys-file/upload"
            name="file"
            :file-list="infoDetail.fileArray"
            :auto-upload="true"
          >
          </el-upload>
          <div v-else style='margin-top:10px'>暂无</div>
      </div>
    </el-card>
      <el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>适用设备</span></div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="deviceNum" label="设备编号" ></el-table-column>
            <el-table-column prop="deviceName" label="设备名称" ></el-table-column>
            <el-table-column prop="category" label="类别" > </el-table-column>
            <el-table-column prop="brandName" label="品牌" > </el-table-column>
            <el-table-column prop="specification" label="规格型号"> </el-table-column>
      </el-table>
       <div style="text-align:right;margin-top:20px;">
                <el-pagination
  background
  :pager-count="5"
  layout="total,prev, pager, next"
 small
 :page-size="devPage.pageSize"
 @current-change="handleCurrentChange"
 :current-page.sync="devPage.currentPage"
  :total="devPage.total">
</el-pagination>
            </div>
    </el-card>
  </div>
</template>
<script>
import { getObj,getRelateDev } from "@/api/ems/equipDisposal/allocation";
export default {
  data() {
    return {
      infoDetail:{
        fileArray:[]
      },
      tableData: [
      ],
      devPage:{
         currentPage: 1,
         total:0,
         pageSize:5,
      },
     
    };
  },
  mounted() {
    this.id = this.$route.query.id;
    this.getObjList();
     this.getDevDrawe();
  },
  methods: {
    getObjList() {
      getObj(this.id).then((res) => {
        this.infoDetail = res.data.data;
        if (this.infoDetail.fileArray && this.infoDetail.fileArray.length > 0) {
        this.infoDetail.fileArray[0].name=this.infoDetail.fileArray[0].fileName
      }else{
          this.infoDetail.fileArray=[]
      }
      });
    },
     handleCurrentChange(index){
        this.devPage.currentPage = index;
         this.getDevDrawe();
    },
    getDevDrawe(){
       this.tableData=[]
      getRelateDev({transferId: this.id,size:this.devPage.pageSize,current:this.devPage.currentPage}).then((res)=>{
            this.tableData = res.data.data.records;
            this.devPage.total = res.data.data.total;
          })
    },
  },
};
</script>
<style lang="scss" scoped>
@import "@/styles/color.scss";
.headerStyle {
  margin-bottom: 20px;
}
.tableTitle {
  color: #333;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
}
.smallTitle {
  color: rgba(153, 153, 153, 100);
  font-size: 12px;
  margin-left: 10px;
}
.devTitle {
  color: #262626;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.box-card {
  margin-bottom: 10px;
  .el-card__body {
    padding-top: 10px;
  }
  .labelS {
    flex: 0 0 150px;
    text-align: left;
    color: #606266;
    padding: 10px;
    border: 1px solid rgba(236, 240, 244, 100);
    margin-bottom: -1px;
  }
  .contentS {
    border: 1px solid rgba(236, 240, 244, 100);
    color: #606266;
    width: 100%;
    margin-left: -1px;
    margin-bottom: -1px;
    padding: 10px;
    // margin: 10px 0;
    // width: calc(100% - 120px);
    // display: inline-block;
  }
  .tableStyle {
    display: flex;
  }
  .number {
    font-weight: bold;
    margin-top: 5px;
    font-size: 16px;
  }
  .nocomplate {
    color: white;
    //   background-color: #E83672;
    padding: 3px 5px;
    border-radius: 3px;
    font-size: 12px;
  }
  .complate {
    background-color: #57c4b0;
  }
}
</style>
